/*
 * 文件名:CSharedMemory.hpp
 *
 * 	 功能描述:
 *  创建日期: 2010-12-25
 *  版本Ver0.01
 *  作者: huanying2000
 *  版权:copyright 2010 by the Camellia project 
 *  free software under the terms of the LGPL 2.1
 */

#ifndef CSHAREDMEMORY_HPP_
#define CSHAREDMEMORY_HPP_

#include "Globel.hpp"

template <typename T>
class CSharedMemory
{
	public:
	        T *pMsg;

	        CSharedMemory(key_t shmkey = 0x123457);
	        ~CSharedMemory();
	        void initShm();
	        void rmShm();

	   private:
	        int shmid;
	        key_t key;
	        struct shmid_ds shmemds;
};

#endif /* CSHAREDMEMORY_HPP_ */
